6DOF IMU 26 Click
6DOF IMU 26 Click demo application is developed using the NECTO Studio, ensuring compatibility with mikroSDK's open-source libraries and tools. Designed for plug-and-play implementation and testing, the demo is fully compatible with all development, starter, and mikromedia boards featuring a mikroBUS™ socket.
Click Library
- Author : Stefan Filipovic
- Date : Feb 2025.
- Type : SPI type
Software Support
Example Description
This example demonstrates the use of the 6DOF IMU 26 Click board, which provides 3-axis accelerometer and 3-axis gyroscope measurements, as well as temperature data. The example initializes the device and continuously logs sensor readings.
Example Libraries
- MikroSDK.Board
- MikroSDK.Log
- Click.6DOFIMU26
Example Key Functions
- c6dofimu26_cfg_setup This function initializes Click configuration structure to initial values.
void c6dofimu26_cfg_setup(c6dofimu26_cfg_t *cfg)
6DOF IMU 26 configuration object setup function.
6DOF IMU 26 Click configuration object.
Definition c6dofimu26.h:239
- c6dofimu26_init This function initializes all necessary pins and peripherals used for this Click board.
err_t c6dofimu26_init(c6dofimu26_t *ctx, c6dofimu26_cfg_t *cfg)
6DOF IMU 26 initialization function.
6DOF IMU 26 Click context object.
Definition c6dofimu26.h:220
- c6dofimu26_default_cfg This function executes a default configuration of 6DOF IMU 26 Click board.
err_t c6dofimu26_default_cfg(c6dofimu26_t *ctx)
6DOF IMU 26 default configuration function.
- c6dofimu26_get_data This function reads the accelerometer, gyroscope, and temperature data.
err_t c6dofimu26_get_data(c6dofimu26_t *ctx, c6dofimu26_data_t *data_out)
6DOF IMU 26 get all sensor data function.
6DOF IMU 26 Click data structure.
Definition c6dofimu26.h:274
Application Init
Initializes the logger and configures the 6DOF IMU 26 Click board. Sets up SPI communication and applies the default configuration.
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
@ C6DOFIMU26_ERROR
Definition c6dofimu26.h:288
#define C6DOFIMU26_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition c6dofimu26.h:204
void application_init(void)
Definition main.c:35
#define MIKROBUS_POSITION_6DOFIMU26
Definition main.c:29
Application Task
Continuously reads and logs acceleration (g), gyroscope (dps), and temperature (degC) values from the sensor.
{
{
log_printf( &logger,
" Accel X: %.3f g\r\n", meas_data.
accel.
x );
log_printf( &logger,
" Accel Y: %.3f g\r\n", meas_data.
accel.
y );
log_printf( &logger,
" Accel Z: %.3f g\r\n", meas_data.
accel.
z );
log_printf( &logger,
" Gyro X: %.1f dps\r\n", meas_data.
gyro.
x );
log_printf( &logger,
" Gyro Y: %.1f dps\r\n", meas_data.
gyro.
y );
log_printf( &logger,
" Gyro Z: %.1f dps\r\n", meas_data.
gyro.
z );
log_printf( &logger,
" Temperature: %.2f degC\r\n\n", meas_data.
temperature );
Delay_ms ( 100 );
}
}
@ C6DOFIMU26_OK
Definition c6dofimu26.h:287
void application_task(void)
Definition main.c:71
float y
Definition c6dofimu26.h:264
float x
Definition c6dofimu26.h:263
float z
Definition c6dofimu26.h:265
c6dofimu26_axes_t gyro
Definition c6dofimu26.h:276
c6dofimu26_axes_t accel
Definition c6dofimu26.h:275
float temperature
Definition c6dofimu26.h:277
Application Output
This Click board can be interfaced and monitored in two ways:
- Application Output - Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
- UART Terminal - Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.
Additional Notes and Information
The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.